<?php

class PageMisc {
	
	public function pagePopup() {
		return '<div class="popup-request" id="popup_request"></div>';	
	}
	
	public function pageTopHeader($strDirectoryThumbs, $strDirectoryImage, $strName = '', $strImage = '', $strAccountType = '', $strSY = '') {
		
		$imagePreview = ( file_exists($strDirectoryThumbs . $strImage) && !empty($strImage)) ? $strImage : 'person_blank.jpg';
		
		switch($strAccountType) {
			case 'A': $accountType = "Administrator's Account"; break;
			case 'R': $accountType = "Registrar's Account"; 	break;
			case 'D': $accountType = "Dean's Account"; 			break;
			case 'P': $accountType = "Faculty's Account"; 	break;
			case 'S': $accountType = "Student's Account"; 		break;
		}
		
		if (!empty($strSY)) {
			$sisplaySY = $strSY;
		}
		
		$html = '<img src="' . $strDirectoryImage . 'icon/loading_round.gif" border="0" style="visibility:hidden;"/>
				 <img src="' . $strDirectoryImage . 'loading_bar.gif" border="0" style="visibility:hidden;"/>
				 <div class="top-header">
					 <div class="top-header-width">
						<div class="top-header-name-logo" onclick="homePageLink();">
							<div class="top-header-logo"></div>
							<div class="top-header-name">MSEUF</div>
						</div>
						<div class="top-header-menu">
								<ul class="top-ul-menu-button">
									<li class="top-li-menu-button">
										<div class="top-header-menu-user" onclick="homePageLink();">
											<div class="top-header-menu-picture"><img src="' . $strDirectoryThumbs . $imagePreview . '" width="24" height="24" border="0" id="user_picture"/></div>
											<div class="top-header-menu-name">' . $strName . '</div>
										</div>
									</li>
									<li class="top-li-menu-button">
										<div class="top-header-menu-home" onclick="homePageLink();">Home</div>
									</li>
									<li class="top-li-menu-button-settings" onclick="showMouseSettings();">
										<div class="top-header-menu-logout cursor-pointer">
										<img src="' . $strDirectoryImage  . 'logout.png" border="0" id="logout_button"/>
											<div class="mouseover-settings" id="mouseover_settings">
												<div class="mouseover-settings-block" onclick="hideMouseSettings();"></div>
												<ul class="top-ul-settings">
													<li class="top-li-settings-label">Settings</li>
													<li class="top-li-settings-break"></li>
													<li class="top-li-settings" onclick="popupRequest(\'show\', \'PersonalInformation\', \'Personal Information\', \'400\', \'500\', \'\');">Personal Information</li>
													<li class="top-li-settings" onclick="popupRequest(\'show\', \'ChangePicture\', 		 \'Change Picture\', 		\'280\', \'500\', \'\');">Picture</li>
													<li class="top-li-settings" onclick="popupRequest(\'show\', \'ChangePassword\', 	 \'Change your password?\', \'245\', \'500\', \'\');">Change Password</li>
													<li class="top-li-settings-break"></li>
													<li class="top-li-settings" onclick="logout()">Log Out</li>
												</ul>
											</div>
										</div>
									</li>
								</ul>
						</div>
					</div>
				 </div>
				 <div class="top-hide-header"></div>
				 <div class="top-account-header">' . $accountType . ' (' . $sisplaySY . ')</div>';
		return $html;
	}
	
	public function deanSubMenu($dirImage) {
		$str = '<div class="page-sub-menu">
						<div class="page-sub-menu-label">
							<div class="page-sub-menu-label-img"><img src="' . $dirImage . 'icon/menu_settings.png" border="0"/></div>
							<div class="page-sub-menu-label-lbl">Main Menu</div>
						</div>
						<table width="0" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td>
									<ul class="ul-sub-menu">
										<li class="li-sub-menu">
											<a href="?page=Students" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/students.png" border="0"/></div>
												<div class="float-left">Student Enrollment</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=Announcement" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/announcement.png" border="0"/></div>
												<div class="float-left">Announcement</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=Course" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/course.png" border="0"/></div>
												<div class="float-left">Courses/Subjects</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=Faculty" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/faculty.png" border="0"/></div>
												<div class="float-left">Faculty Profile</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=ChecklistHeader" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/header.png" border="0"/></div>
												<div class="float-left">Checklist Header</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=TuitionFees" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/subject.png" border="0"/></div>
												<div class="float-left">Department Sections</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=DepartmentRooms" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/rooms.png" border="0"/></div>
												<div class="float-left">Department Rooms</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=GradesParticularSemester" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/course.png" border="0"/></div>
												<div class="float-left">Student Reports</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=CourseSchedule" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/reports.png" border="0"/></div>
												<div class="float-left">Schedules</div>
											</a>
										</li>
									</ul>
								</td>
							</tr>
						</table>
					</div>';
					/*
						<li class="li-sub-menu">
							<a href="?page=DeanReports" class="a-sub-menu">
								<div class="float-left"><img src="' . $dirImage . 'icon/reports.png" border="0"/></div>
								<div class="float-left">Reports/Summary</div>
							</a>
						</li>
					*/
		return $str;
	}
	
	public function registrarSubMenu($dirImage) {
		$str = '<div class="page-sub-menu">
						<div class="page-sub-menu-label">
							<div class="page-sub-menu-label-img"><img src="' . $dirImage . 'icon/menu_settings.png" border="0"/></div>
							<div class="page-sub-menu-label-lbl">Main Menu</div>
						</div>
						<table width="0" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td>
									<ul class="ul-sub-menu">
										<li class="li-sub-menu">
											<a href="?page=Students" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/students.png" border="0"/></div>
												<div class="float-left">Student Validation</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=StudentRequest" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/faculty.png" border="0"/></div>
												<div class="float-left">Student Request</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=AcademicCalendar" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/header.png" border="0"/></div>
												<div class="float-left">Academic Calendar</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=StudentIncGrade" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/grades.png" border="0"/></div>
												<div class="float-left">Student w/ INC Grade</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=GradesParticularSemester" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/course.png" border="0"/></div>
												<div class="float-left">Student Reports</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=SemesterSY" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/note.png" border="0"/></div>
												<div class="float-left">Semester/SY</div>
											</a>
										</li>
									</ul>
								</td>
							</tr>
						</table>
					</div>';
		return $str;
	}
	
	public function professorSubMenu($dirImage) {
		$str = '<div class="page-sub-menu">
						<div class="page-sub-menu-label">
							<div class="page-sub-menu-label-img"><img src="' . $dirImage . 'icon/menu_settings.png" border="0"/></div>
							<div class="page-sub-menu-label-lbl">Main Menu</div>
						</div>
						<table width="0" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td>
									<ul class="ul-sub-menu">
										<li class="li-sub-menu">
											<a href="?page=ProfViewAnnouncement" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/announcement.png" border="0"/></div>
												<div class="float-left">Announcement</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=ProfStudents" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/students.png" border="0"/></div>
												<div class="float-left">Enrolled Students</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=GradeReports" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/reports.png" border="0"/></div>
												<div class="float-left">Student Reports</div>
											</a>
										</li>
										<li class="li-sub-menu">
											<a href="?page=FacultySchedules" class="a-sub-menu">
												<div class="float-left"><img src="' . $dirImage . 'icon/course.png" border="0"/></div>
												<div class="float-left">My Schedules</div>
											</a>
										</li>
									</ul>
								</td>
							</tr>
						</table>
					</div>';
		return $str;
	}
	
	public function studentSubMenu($dirImage, $strArray) {
		
		if ( !empty($strArray) ) {
			$strURL = '&' . http_build_query($strArray);
		}
		
		$str = '<ul class="student-ul-sub-menu">
						<li class="student-li-sub-menu">
							<a href="?page=MyAnnouncement" class="student-a-sub-menu">
								<div class="float-left"><img src="' . $dirImage . 'icon/announcement.png" border="0"/></div>
								<div class="float-left">Announcement</div>
							</a>
						</li>
						<li class="student-li-sub-menu">
							<a href="?page=MySchedules' . $strURL . '" class="student-a-sub-menu">
								<div class="float-left"><img src="' . $dirImage . 'icon/preview.png" border="0"/></div>
								<div class="float-left">My Schedules</div>
							</a>
						</li>
						<li class="student-li-sub-menu">
							<a href="?page=MyGrades" class="student-a-sub-menu">
								<div class="float-left"><img src="' . $dirImage . 'icon/students.png" border="0"/></div>
								<div class="float-left">Grades</div>
							</a>
						</li>
						<li class="student-li-sub-menu">
							<a href="?page=MyCurriculum" class="student-a-sub-menu">
								<div class="float-left"><img src="' . $dirImage . 'icon/reports.png" border="0"/></div>
								<div class="float-left">Curriculum</div>
							</a>
						</li>
					</ul>';
					/*
						<li class="student-li-sub-menu">
							<a href="?page=MyPayments" class="student-a-sub-menu">
								<div class="float-left"><img src="' . $dirImage . 'icon/course.png" border="0"/></div>
								<div class="float-left">Financial Ledger</div>
							</a>
						</li>
					*/
		return $str;
	}
	
	public function studentName($dirImage, $strDirectoryThumbs, $strImage, $strArrDetails, $strArray = '') {

		$imagePreview = ( file_exists($strDirectoryThumbs . $strImage) && !empty($strImage)) ? $strImage : 'person_blank.jpg';
		
		$studMenu = $this->studentSubMenu($dirImage, $strArray);
		
		$strName	= $strArrDetails['name'];
		$strStudNo	= $strArrDetails['stud_no'];
		$strCourse	= $strArrDetails['course'];
		$strSection	= ($strArrDetails['section']) ? $strArrDetails['section'] : '';
		$strRegular	= $strArrDetails['regular'];
		
		$str = '<div class="main-name-details">
					<div class="main-name-details-picture">
						<img src="' . $strDirectoryThumbs . $imagePreview . '" width="150" height="150" border="0" class="main-name-details-img"/>
					</div>
					<div class="main-name-details-desc">
						<div class="main-name-details-description">
							<div class="main-name-details-desc-name">' . $strName . '</div>
							<div class="main-name-details-desc-stud"><span class="main-name-label">#:</span> ' . $strStudNo . '</div>
							<div class="main-name-details-desc-stud"><span class="main-name-label">C:</span> ' . $strCourse . '</div>
							<div class="main-name-details-desc-stud"><span class="main-name-label">S:</span> ' . $strSection . ' <em><span class="font-red">' . $strRegular . '</span></em></div>
							<div class="main-name-details-desc-menu">' . $studMenu . '</div>
						</div>
					</div>
				</div>';
		return $str;
	}
	
	public function studentActiveSemester($dirImage, $strArrSemester, $strPage, $strHash = '', $strEnrollNow = false, $strFontStrike = '', $strActiveSem = '') {
		
		$str = '<ul class="semester-ul-sub-menu">';
		if ( !empty($strArrSemester) ) {
			foreach($strArrSemester as $strArrSemesterValue) {
				
				if ( $strActiveSem == $strArrSemesterValue['stud_sem_active'] ) {
					$fontStrike = $strFontStrike;
				}

				$str .= '<li class="semester-li-sub-menu" onclick="linkNewPage(\'MyGrades&said=' . $strArrSemesterValue['stud_sem_active'] . '&hAsh=' . $strHash . '\')">
							<div class="float-left ' . $fontStrike . '"><img src="' . $dirImage . 'icon/down.png" border="0"/></div>
							<div class="float-left ' . $fontStrike . '">' . $strArrSemesterValue['sem_desc'] . '</div>
						</li>';
			}
		}
		else {
			$str .= '<li class="semester-li-sub-menu">
							<div class="float-left"><img src="' . $dirImage . 'icon/down.png" border="0"/></div>
							<div class="float-left">Not Yet Enroll</div>
						</li>';
		}
		
		if ($strEnrollNow === true) {
			$str .= '<li class="semester-li-sub-menu">
						<div class="float-left"><img src="' . $dirImage . 'icon/refresh.png" border="0"/></div>
						<div class="float-left"><u><a href="?page=MyEnrollment" class="semester-li-sub-menu-enroll">ENROLL NOW</a></u></div>
					 </li>';
		}
		$str .= '</ul>';
		
		return $str;
	}
	
	public function pageFooter() {
		return '<div class="login-footer">
					<div class="login-footer-is">Web-based Student Integrated Information System</div>
					<div class="login-footer-copy">Copyright &copy; 2013</div>
				</div>';	
	}
}

?>